package trab3.msgs;

import java.awt.Color;

import sim.core.*;

public class SyncClockEvent2 extends Message {
	public double M0, M1, S ;
	
	public SyncClockEvent2( double m0, double s ) {
		super(false, Color.red ) ;
		this.M0 = m0 ;
		this.S = s ;
	}
		
	public void setM1( double m1 ) {
		this.M1 = m1 ;
	}
	
	public double rtt() {
		return M1 - M0 ;
	}
	
	/* (non-Javadoc)
	 * <b>IMPORTANT!!!</b> Include a copy of this method in every class that extends Message
	 * @see sim.core.Message#deliverTo(sim.net.EndPoint, sim.core.MessageHandler)
	 */
	public void deliverTo( EndPoint src, MessageHandler handler ) {
		((ExtendedMessageHandler)handler).onReceive( src, this ) ;
	}
}
